package pattern.component;

/*
 * @author changfei
 * @date  2023/11/28 15:56
 * @description
 */
public abstract class MenuComponent {
    String name;
    Integer level;

    public  void add(MenuComponent menuComponent){
        System.out.println("不支持add");
        return;
    }
    public  void remove(MenuComponent menuComponent){
        System.out.println("不支持remove");
        return;
    }

    public  void print(){
        System.out.println("不支持print");
        return;
    }

    public String getName() {
        System.out.println("不支持name");
        throw new UnsupportedOperationException("不支持获取名字操作!");
    }
}
